package com.sinosoft.perfect.system._roleBusiness.service;

import java.sql.SQLException;
import java.util.List;

import com.sinosoft.perfect.system._.po.TRoleBusiness;

public interface IRoleBusinessService {

	/**
	 * 插入一条记录，实现类中先调用了查询最大次数的方法（selectTRoleBusinessMAXSortNum）。
	 */
	public String insertByTRoleBusiness(TRoleBusiness troleBusiness) throws SQLException;

	public Integer selectTRoleBusinessMAXSortNum() throws SQLException;

	public List<TRoleBusiness> selectByTRoleBusiness(TRoleBusiness troleBusiness, int startIndex, int endIndex) throws SQLException;

	public List<TRoleBusiness> selectByTRoleBusiness(TRoleBusiness troleBusiness) throws SQLException;

	/**
	 * 根据组织机构id，查询该机构下的用户与业务角色的关联
	 */
	public List<String> selectTRoleBusinessFromUnit(String unitId) throws SQLException;

	/**
	 * 根据用户id，查询用户与业务角色的关联
	 */
	public List<String> selectTRoleBusinessFromUser(String userId) throws SQLException;

	public Long selectTRoleBusinessSortNum(String roleBusinessId) throws SQLException;

	/**
	 * 更新一条记录。
	 */
	public void updateTRoleBusinessByPrimaryKey(TRoleBusiness troleBusiness) throws SQLException;

	/**
	 * 删除一条记录。
	 */
	public void deleteTRoleBusinessByPrimaryKey(TRoleBusiness troleBusiness) throws SQLException;

	/**
	 * 上下移动排序的方法。
	 */
	public boolean sortRoleBusiness(long newSortNumber, String roleBusinessId) throws SQLException;
	/**
	 * 查询当前业务角色下的用户Id，拼成串，dwr调用(fys 11/07/14)
	 * @param troleSystem 主要是使用该对象里的roleSystemId属性
	 * @return 该系统角色下的所用用户id，并用','隔开；
	 * @throws SQLException
	 */
	public String selectExitsUsers(TRoleBusiness tRoleBusiness) throws SQLException;
}
